package wei.Entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;

@Entity
public class Course{

    @Id
    private int courseid;//课程代码
    private String courseName;//课程名称
    private String courseType;//课程类别(选修、必修)
    private int credit;//学分

    @ManyToMany(fetch = FetchType.LAZY)
    private Set<Student> stu =new HashSet<Student>();

    public Course() {
    }

    public Course( int courseid, String courseName, String courseType, int credit){
        this.courseid = courseid;
        this.courseName = courseName;
        this.courseType = courseType;
        this.credit = credit;
    }

    public void setStudent(Set<Student> stu) {
        this.stu=stu;
    }
    public void setCourseid(int courseid) {
        this.courseid = courseid;
    }
    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }
    public void getCourseType(String courseType) {
        this.courseType = courseType;
    }
    public void getCredit(int credit) {
        this.credit = credit;
    }

    public int getCourseId() {

        return courseid;
    }
    public String getCourseName() {

        return courseName;
    }
    public String getCourseType() {

        return courseType;
    }
    public int getCredit() {

        return credit;
    }
    public Set<Student> getStudent() {

        return stu;
    }

}